﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace Classes
{
        [DataContract]
    
    public class Flight
    {
            
        City from;
          
        City to;
            
        int priceOfFlight;
           
        bool found;
            
        int id;
            
        int priceOfTheOneSeat;
     
            DateTime departureTime;
             
        DateTime arrivalTime;
        string fromName;
        [DataMember]  
        public string FromName
        {
            get { return fromName; }
            set { fromName = value; }
        }
        string toName;
        [DataMember]  
        public string ToName
        {
            get { return toName; }
            set { toName = value; }
        }
            
        string company;

           
        private int noOfSeats;

        
        public Flight(City from, City to) // shouldn't we add rest of the fields into constructor or make new one withh all of them ?
        {
            this.from = from;
            this.to = to;
            
        }

[DataMember]
        public int NoOfSeats
        {
            get { return noOfSeats; }
            set { noOfSeats = value; }
        }

[DataMember]
        public string Company
        {
            get { return company; }
            set { company = value; }
        }

          [DataMember]
        public int Id
        {
            get { return id; }
            set { id = value; }
        }
                       
        public City From
        {
            get
            {
                return from;
            }
        }
                        
        public City To
        {
            get
            {
                return to;
            }
        }
             
        public void SetFound(bool value)
        {
            found = value;
        }
            
        public bool Found
        {
            get
            {
                return found;
            }
        }
        public void SetPriceOfConnection(int value)
        {
             priceOfFlight = value;

        }
             
        public int GetPriceOfFlight()
        {
            return priceOfFlight;
        }
                           
            [DataMember]
        public int PriceOfTheOneSeat
        {
            get { return priceOfTheOneSeat; }
            set { priceOfTheOneSeat = value; }
        }
                 [DataMember]      
        public DateTime DepartureTime
        {
            get { return departureTime; }
            set { departureTime = value; }
        }
           [DataMember]
        public DateTime ArrivalTime
        {
            get { return arrivalTime; }
            set { arrivalTime = value; }
        } 
    }
}
